﻿using System;
using MCP.Data.Client.Message.Enum;

namespace MCP.Data.Client.Message
{
	public class SimpleMessage : MessageBase
	{
        public SimpleMessage(string message, MessagePriority priority, MessageType type) : base()
        {
            this.Text = message;
            this.Priority = priority;
            this.Type = type;
        }

        public class Check
        {
            public static SimpleMessage GetCheckDeletedMessage(MCP.Data.GEntities.Check check)
            {
                string message = String.Format(
                    "Check from {0} ({1} {2}) has been successfuly deleted.",
                    check.Date.ToShortDateString(),
                    check.Items.Count,
                    check.Items.Count > 1 ? "items" : "item");
                var simpleMessage = new SimpleMessage(message, MessagePriority.Medium, MessageType.Notification);

                return simpleMessage;
            }

            public static SimpleMessage GetCheckCreatedSuccessfulyMessage()
            {
                var simpleMessage = new SimpleMessage(
                    "New check was successfuly added.",
                    MessagePriority.Medium,
                    MessageType.Notification);

                return simpleMessage;
            }
        }

        public class Category
        {
            public static SimpleMessage GetCategoriesAddedMessage(int count)
            {
                string message = string.Format("{0} new {1} has been added.", count, count > 1 ? "categories" : "category");
                var simpleMessage = new SimpleMessage(message, MessagePriority.Low, MessageType.Notification);

                return simpleMessage;
            }
        }
	}
}